<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!doctype html>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>待办信息</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	
	<jsp:include page="/WEB-INF/views/common.jsp"></jsp:include>
<style type="text/css">
body, div, ul, li {margin: 0; padding: 0;}
ul, li {list-style: none;}
font{font-size: 14px;}
#ul_count li {
	height: 32px;
	line-height: 32px;
    border-bottom: 1px dashed #bec3c7;
}
#ul_count span {color: grey;}
#ul_count span a {color: #000000; text-decoration: none;}
</style>	
  </head>
  
  <body>
    <div id="div_count">
    	<ul id="ul_count"></ul>
    </div>
  </body>
<script type="text/javascript">
$(function(){
	/**待办任务*/
	$.post('personInfo/todoCountData.shtml',function (data) {
		//{"success":true,"message":null,"data":[{"name":"todoTask","menuId":"45","count":2}]}
		if (data.success) {
			var datas = data.data;
			//console.log(datas.length);
			for (var i=0; i < datas.length; i++) {
				var obj = datas[i];
				if (obj.name = 'todoTask') {
					var _phtml = '<li><span><a href="javascript:showToDetail(\'' + obj.menuName + '\',\'' + obj.menuUrl + '\',\'' + obj.menuId + '\');">您有<font color="red">' + obj.count + '</font>件【任务待办】待处理</a></span></li>';
					$('#ul_count').html(_phtml);
				}
				
			}
		} else {
			$('#ul_count').html('<li><font color="green">恭喜您，当前没有紧急任务！</font></li>');
		}
	});
});

function showToDetail(title, url, menuId) {
	window.parent.addTab(title, url, menuId);
}
</script>  
</html>
